package com.sky.controller.user;

import com.sky.result.Result;
import com.sky.utils.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/shop")
@Slf4j
public class ShopStatusController {
    public static final String KEY = "SHOP_STATUS";
    @Autowired
    private RedisUtil redisUtil;
    @GetMapping("/status")
    public Result<Integer> getStatus(){
        Integer status  = (Integer) redisUtil.get(KEY);
        log.info("获得状态码{}",status);
        return Result.success(status);
    }
}
